package com.tencent.wxcloudrun.config;

import com.google.common.eventbus.EventBus;
import com.tencent.wxcloudrun.listener.EventListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @Author ZhaoZiYin
 * @Date 2025/4/29
 * @Description TODO
 */
@Component
public class EventBusRegistry {

    @Autowired
    private EventBus eventBus;

    @Autowired
    private EventListener eventListener;

    @PostConstruct
    public void registerListeners() {
        // 注册监听器
        eventBus.register(eventListener);
        System.out.println("eventListener has been registered to EventBus.");
    }

}
